<Window x:Uid="Window_1" x:Class="Adastra.RichEditorLibrary.TablePropertiesDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:Microsoft.WPFControlsLibrary;assembly=WPFControlsLibrary" 
        xmlns:properties="clr-namespace:Adastra.RichEditorLibrary.Properties"
    Title="Tabulka" Height="450" Width="450">
    <!-- -->
    <Window.Resources>
        <ResourceDictionary x:Uid="ResourceDictionary_1">
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary x:Uid="ResourceDictionary_2" Source="..\Resources\Styles\MainViewStyles.xaml"/>


            </ResourceDictionary.MergedDictionaries>

            <!-- NumricEditorStyle -->
            <Style x:Uid="Style_1" x:Key="NumricEditorStyle" TargetType="{x:Type controls:ValueEditor}">
                <Setter x:Uid="Setter_1" Property="Template">
                    <Setter.Value>
                        <ControlTemplate x:Uid="ControlTemplate_1" TargetType="{x:Type controls:ValueEditor}">
                            <Grid x:Uid="Grid_1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Uid="ColumnDefinition_1" Width="0.5*"/>
                                    <ColumnDefinition x:Uid="ColumnDefinition_2" />
                                </Grid.ColumnDefinitions>
                                <controls:NumberTextBox x:Uid="PART_EDITOR" x:Name="PART_EDITOR" Style="{DynamicResource NumricTextBoxStyle}" Text="{Binding Path=Value, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Grid.ColumnSpan="2"/>
                                <Rectangle x:Uid="PART_DRAGGER" x:Name="PART_DRAGGER"  Stroke="Transparent" Fill="Transparent" />
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger x:Uid="Trigger_1" Property="IsMouseOver" Value="True" SourceName="PART_DRAGGER">
                                    <Setter x:Uid="Setter_2" Property="Cursor" Value="SizeAll"/>
                                </Trigger>
                                <Trigger x:Uid="Trigger_2" Property="IsDragging" Value="True">
                                    <Setter x:Uid="Setter_3" Property="Cursor" Value="SizeAll"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            
        </ResourceDictionary>
    </Window.Resources>
    <Grid x:Uid="Grid_2">
        <Grid.Resources>
            <Style x:Uid="Style_2" TargetType="{x:Type ToggleButton}" x:Key="PicRes">
                <Setter x:Uid="Setter_4" Property="Width" Value="42"></Setter>
                <Setter x:Uid="Setter_5" Property="Height" Value="38"></Setter>
            </Style>
        </Grid.Resources>

        <Grid.RowDefinitions>
            <RowDefinition x:Uid="RowDefinition_1" Height="276*" />
            <RowDefinition x:Uid="RowDefinition_2" Height="35" />
        </Grid.RowDefinitions>
        <TabControl x:Uid="m_tabbedWorkspace" Grid.Row="0" x:Name="m_tabbedWorkspace" Margin="1,1,1,1" >
            <TabItem x:Uid="m_tabProperties" x:Name="m_tabProperties" Header="Základní vlastnosti" >
                <Grid x:Uid="Grid_3">
                    <Grid.RowDefinitions>
                        <RowDefinition x:Uid="RowDefinition_3"/>
                        <RowDefinition x:Uid="RowDefinition_4"/>
                    </Grid.RowDefinitions>
                    <GroupBox x:Uid="GroupBox_1" Header="Vzhled tabulky" Grid.Row="0" BorderThickness="0.2">
                        <Grid x:Uid="Grid_4">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Uid="ColumnDefinition_3" Width="100" />
                                <ColumnDefinition x:Uid="ColumnDefinition_4" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition x:Uid="RowDefinition_5" Height="30"/>
                                <RowDefinition x:Uid="RowDefinition_6" Height="30"/>
                                <RowDefinition x:Uid="RowDefinition_7" Height="0"/>
                                <RowDefinition x:Uid="RowDefinition_8" Height="30"/>
                            </Grid.RowDefinitions>
                            <Label x:Uid="Label_1" Grid.Column="0" Grid.Row="0" Content="{x:Static properties:Resources.TablePropertiesDialog_Label_1_Content}" Margin="10,0,0,0" Foreground="Black"/>
                            <!--TextBox Grid.Column="1" Grid.Row="0" Name="m_txBxRows" Text="{Binding Path=Rows, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" 
                                     Height="21" Width="107" Margin="10,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/-->
                            <controls:ValueEditor  x:Uid="m_txBxRows" Name="m_txBxRows" Height="20" Width="107" Margin="10,5,0,0" Grid.Column="1" Grid.Row="0"
                                                        Style="{DynamicResource NumricEditorStyle}"
                                                        Value="{Binding Path=Rows, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                                                        LargeChange="2" HorizontalAlignment="Left" VerticalAlignment="Top"
                                                        MaxPrecision="0"
                                                        Minimum="0"
                                                        SmallChange="1"
                                                        DefaultChange="1"/>


                            <Label x:Uid="Label_2" Grid.Column="0" Grid.Row="1" Content="{x:Static properties:Resources.TablePropertiesDialog_Label_2_Content}" Margin="10,0,0,0" Foreground="Black"/>
                            <!--TextBox Grid.Column="1" Grid.Row="1" Name="m_txBxColumns" Text="{Binding Path=Columns, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" 
                                     Height="21" Width="107" Margin="10,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/-->
                            <controls:ValueEditor  x:Uid="m_txBxColumns" Name="m_txBxColumns" Height="20" Width="107" Margin="10,5,0,0" Grid.Column="1" Grid.Row="1"
                                                        Style="{DynamicResource NumricEditorStyle}"
                                                        Value="{Binding Path=Columns, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                                                        LargeChange="2" HorizontalAlignment="Left" VerticalAlignment="Top"
                                                        MaxPrecision="0"
                                                        Minimum="0"
                                                        SmallChange="1"
                                                        DefaultChange="1"/>

                            <Label x:Uid="Label_3" Grid.Column="0" Visibility="Hidden" Grid.Row="2"  Content="{x:Static properties:Resources.TablePropertiesDialog_Label_3_Content}" Foreground="Black" Margin="10,0,0,0" />
                            <ComboBox x:Uid="m_comboBackColor" Grid.Column="1" Visibility="Hidden" Grid.Row="2" Width="107" Margin="10,0,0,0" Height="23" Name="m_comboBackColor" Text="Arial" HorizontalAlignment="Left" IsEnabled="False" />

                            <Label x:Uid="Label_4" Grid.Column="0" Grid.Row="3"  Content="{x:Static properties:Resources.TablePropertiesDialog_Label_4_Content}" Foreground="Black" Margin="10,0,0,0" />
                            <StackPanel x:Uid="StackPanel_1" Grid.Column="1" Grid.Row="3" Orientation="Horizontal">
                                <controls:ValueEditor  x:Uid="m_txtCellWidth" Name="m_txtCellWidth" Height="20" Width="107" Margin="10,0,0,0" 
                                                        Style="{DynamicResource NumricEditorStyle}"
                                                        Value="{Binding Path=CellWidth, UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
                                                        LargeChange="10"
                                                        MaxPrecision="2"
                                                        Minimum="0"
                                                        SmallChange="5"
                                                        DefaultChange="1" />
                                <CheckBox x:Uid="m_chBxAutoCellWidth" Name="m_chBxAutoCellWidth" Margin="10,0,0,0" IsChecked="{Binding Path=IsCellWidthAutomatic, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                                          HorizontalAlignment="Center" VerticalAlignment="Center" Content="{x:Static properties:Resources.TablePropertiesDialog_m_chBxAutoCellWidth_Content}"/>
                            </StackPanel>
                        </Grid>
                    </GroupBox>
                    <GroupBox x:Uid="GroupBox_2" Header="Okraje" Grid.Row="1" BorderThickness="0.2">
                        <Grid x:Uid="Grid_5">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Uid="ColumnDefinition_5" Width="100" />
                                <ColumnDefinition x:Uid="ColumnDefinition_6" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition x:Uid="RowDefinition_9" Height="40"/>
                                <RowDefinition x:Uid="RowDefinition_10" Height="40"/>
                                <RowDefinition x:Uid="RowDefinition_11" Height="40"/>
                                <RowDefinition x:Uid="RowDefinition_12" Height="40"/>
                            </Grid.RowDefinitions>

                            <StackPanel x:Uid="StackPanel_2" Grid.Row="0" Orientation="Horizontal">
                                <ToggleButton  x:Uid="ToggleButton_1" Style="{StaticResource PicRes}" IsChecked="{Binding Path=IsNoBorder, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
                                    <Image x:Uid="Image_1" Source="..\Resources\NoBorders.png"></Image>
                                </ToggleButton>
                                <Label x:Uid="Label_5" Content="{x:Static properties:Resources.TablePropertiesDialog_Label_5_Content}" Foreground="Black"/>
                            </StackPanel>

                            <StackPanel x:Uid="StackPanel_3" Grid.Row="1" Orientation="Horizontal">
                                <ToggleButton  x:Uid="ToggleButton_2" Style="{StaticResource PicRes}" IsChecked="{Binding Path=IsBoxBorder, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
                                    <Image x:Uid="Image_2" Source="..\Resources\BoxBorder.png"></Image>
                                </ToggleButton>
                                <Label x:Uid="Label_6" Content="{x:Static properties:Resources.TablePropertiesDialog_Label_6_Content}" Foreground="Black"/>
                            </StackPanel>

                            <StackPanel x:Uid="StackPanel_4" Grid.Row="2" Orientation="Horizontal">
                                <ToggleButton  x:Uid="ToggleButton_3" Style="{StaticResource PicRes}" IsChecked="{Binding Path=IsFullBorder, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
                                    <Image x:Uid="Image_3" Source="..\Resources\AllBorders.png"></Image>
                                </ToggleButton>
                                <Label x:Uid="Label_7" Content="{x:Static properties:Resources.TablePropertiesDialog_Label_7_Content}" Foreground="Black"/>
                            </StackPanel>

                            <!-- Border width -->
                            <StackPanel x:Uid="StackPanel_5" Grid.Column="1" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right">
                                <Label x:Uid="Label_8" Content="{x:Static properties:Resources.TablePropertiesDialog_Label_8_Content}" Foreground="Black" Margin="5,0,0,5" HorizontalAlignment="Right"/>
                                <ComboBox x:Uid="m_comboBorderWidth" Margin="2,2,2,2" Width="107" Height="23" Name="m_comboBorderWidth" Text="Arial"  HorizontalAlignment="Right" IsEnabled="False">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate x:Uid="DataTemplate_1">
                                            <StackPanel x:Uid="StackPanel_6" Orientation="Horizontal">
                                                <TextBlock x:Uid="TextBlock_1" Text="{Binding WidthInfo}" Width="20" />
                                                <ContentControl x:Uid="ContentControl_1" Content="{x:Static properties:Resources.TablePropertiesDialog_ContentControl_1_Content}" Width="auto" />
                                            </StackPanel>
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </StackPanel>

                            <!-- Border color -->
                            <StackPanel x:Uid="StackPanel_7" Grid.Column="1" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
                                <Label x:Uid="Label_9" Content="{x:Static properties:Resources.TablePropertiesDialog_Label_9_Content}" Foreground="Black" Margin="5,0,0,5" HorizontalAlignment="Right"/>
                                <ComboBox x:Uid="m_comboBorderColor" Margin="2,2,2,2" Width="107" Height="23" Name="m_comboBorderColor" Text="Arial"  HorizontalAlignment="Right" IsEnabled="False"/>
                            </StackPanel>

                        </Grid>
                    </GroupBox>
                </Grid>

            </TabItem>
        </TabControl>
        <Button x:Uid="Button_1" Grid.Row="1" IsCancel="True" Margin="0,5,108,5" HorizontalAlignment="Right" Width="75" Click="OnCancelClick" >Storno</Button>
        <Button x:Uid="Button_2" Grid.Row="1" IsDefault="True" HorizontalAlignment="Right" Margin="0,5,6,5" Width="75" Click="OnOkClick">OK</Button>

    </Grid>
</Window>
